package edu.jhu.cs.oose.scheduleit.util;


/**
 * The class related to filtering
 * @author oose_group2
 *
 */
public class Filter {
	

	/**
	 * The attribute key of certain schedule
	 */
	private Enum<?> attributeKind;	
	
	/**
	 * The comparator used during filtering
	 */
	private Comparator comparator;

	/**
	 * The given value
	 */
	private Object value;

	/**
	 * The showing order
	 */
	private Boolean ascending;
	

	/**
	 * Indicates this filter is optional
	 */
    private Boolean optional;
	
    /**
     * The constructor of Filter class
     * @param attributeKind	The attribute key
     * @param comparator	The comparator used during filtering
     * @param value			The given value
     * @param ascending		The showing order
     * @param optional		The indication of whether this filter is optional
     */
    @SuppressWarnings("unchecked")
	public Filter(Enum attributeKind, Comparator comparator, Object value,
			Boolean ascending, Boolean optional) {
		super();
		this.attributeKind = attributeKind;
		this.value = value;
		this.ascending = ascending;
		this.comparator = comparator;
		this.optional = optional;
	}

    
 
    @SuppressWarnings("unchecked")
	public Filter(Enum attributeKind, Comparator comparator, Object value,
			Boolean optional) {
    	this(attributeKind,comparator,value,null,optional);
	}



	@SuppressWarnings("unchecked")
	public Filter(Enum attributeKind, Comparator comparator, Object value) {
		this(attributeKind,comparator,value,null,false);
	}

    
    
	@SuppressWarnings("unchecked")
	public Filter(Enum attributeKind, Boolean ascending, Boolean optional) {
		this(attributeKind,null,null,ascending,optional);
	}


	@SuppressWarnings("unchecked")
	public Filter(Enum attributeKind, Boolean ascending) {
		this(attributeKind,null,null,ascending,false);
	}



	/**
	 * The getter of value
	 * @return
	 */
	public Object getValue() {
		return value;
	}

	/**
	 * The getter of ascending
	 * @return
	 */
	public Boolean getAscending() {
		return ascending;
	}

	/**
	 * The getter of comparator
	 * @return
	 */
	public Comparator getComparator() {
		return comparator;
	}


	/**
	 * The getter of AttributeKind
	 * @return
	 */
	public Enum<?> getAttributeKind() {
		return attributeKind;
	}


	/**
	 * The getter of Optional
	 * @return
	 */
	public Boolean getOptional() {
		return optional;
	}
	
	

}
